package seg.tef4.whms.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.example.scan.R;

import seg.tef4.whms.activity.activityinit.SubBaseActivity;
import seg.tef4.whms.apis.UserApi;
import seg.tef4.whms.util.retrofitutil.RetrofitUtil;

public class ReturnIndexActivity extends SubBaseActivity {

    private Button out_button;
    private Button out_search_button;
    private Button out_approval_button;

    private Button out_approval_search_button;

    private UserApi userApi = (UserApi) RetrofitUtil.getApiInstance(UserApi.class);

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_return_index);

        out_button = findViewById(R.id.out_button);
        out_search_button = findViewById(R.id.out_search_button);
        out_approval_button = findViewById(R.id.out_approval_button);
        out_approval_search_button = findViewById(R.id.out_approval_search_button);
        buttonNavigateInit();

    }

    public static void startIndexActivity(Context context){
        context.startActivity(new Intent(context, ReturnIndexActivity.class));
    }

    private void buttonNavigateInit(){
        out_button.setOnClickListener(view -> {
            Intent intent = new Intent(this,ReturnRequestApprovalActivity.class);
            intent.putExtra("type","request");
            startActivity(intent);
        });
        out_search_button.setOnClickListener(view -> {
            Intent intent = new Intent(this,ReturnRequestApprovalActivity.class);
            intent.putExtra("type","approval1");
            startActivity(intent);
        });
        out_approval_search_button.setOnClickListener(view -> {
            Intent intent = new Intent(this,ReturnRequestApprovalActivity.class);
            intent.putExtra("type","approval2");
            startActivity(intent);
        });
        out_approval_button.setOnClickListener(view -> {
            ReturnSearchActivity.startOutWarehouseActivity(ReturnIndexActivity.this);
        });

    }
}
